import axios from '@/utils/axios';

export const getSeriesPage = (params) => {
    return axios.request({
        url: '/series/page',
        method: 'get',
        params
    });
};

export const addSeries = (data) => {
    return axios.request({
        url: '/series/',
        method: 'post',
        data
    });
};

export const deleteSeries = (siteId, seriesId) => {
    return axios.request({
        url: '/series/' + siteId + '/' + seriesId,
        method: 'delete'
    });
};

export const getSeries = (siteId, seriesId) => {
    return axios.request({
        url: '/series/' + siteId + '/' + seriesId,
        method: 'get'
    });
};

export const getAllSeriesSpuList = (data) => {
    return axios.request({
        url: '/series/all/spu/list',
        method: 'post',
        data
    });
};

export const modifySeries = (data) => {
    return axios.request({
        url: '/series/' + data.id,
        method: 'put',
        data
    });
};

export const getSortWhenOption = (params) => {
    return axios.request({
        url: '/series/getSortWhenOptionChange',
        method: 'get',
        params
    });
};

export const copySeries = (data) => {
    return axios.request({
        url: '/series/' + data.siteId + '/' + data.seriesId + '/copy',
        method: 'post',
        data
    });
};

// 系列数据补充
export const dataSupplementySeries = (data) => {
    return axios.request({
        url: '/series/dataSupplement',
        method: 'post',
        data
    });
};
